import "./versionchecker";
import { supportedSites } from "@config";

chrome.runtime.onInstalled.addListener(function () {
  chrome.declarativeContent.onPageChanged.removeRules(undefined, function () {
    const conditions = Object.values(supportedSites).map((item) => {
      return new chrome.declarativeContent.PageStateMatcher({
        pageUrl: { urlContains: item.url },
      });
    });

    chrome.declarativeContent.onPageChanged.addRules([
      {
        conditions: conditions,
        actions: [new chrome.declarativeContent.ShowPageAction()],
      },
    ]);
  });
});
